<template>
  <view  @click="goDetails" class="communityCard test-here" :style="{backgroundImage: 'url(' +  item.build_thumb[0] || replacementImage + ')'}">
    <p class="communityCardTag">
      {{item.tagName || '在售'}}
    </p>
    <p style="font-size: 12px;margin-top: 65px;">{{item.title}}</p>
  </view>
</template>

<script>
  import {appMixin} from "../util/reuse"
  import {uniSetStorageSync} from "../util/funcs"
  import {ROUTER_OBJ, uniNavigate} from "../util/misc"

  export default {
    mixins: [appMixin],
    props: {
      item: {
        type: Object,
        default: {
          tagName: '在售',
          title: '', // 大厦名称
          activity: '', // 活动名称
        }
      }
    },
    data() {
      return {};
    },
    methods: {
      goDetails() {
        uniSetStorageSync(ROUTER_OBJ,{
          ...this.item,
          displayBuildMode: true,
        })
        uniNavigate('/displayDetails/displayBuildDetails')
      }
    }
  }
</script>

<style lang="scss" scoped>
  @import "../assets/styles/global";
  
  .communityCard {
    padding: 10px;
    width: 200px;
    height: 125px;
    background: #808080;
    margin-right: 15px;
    border-radius: 5px;
    @include cover-no-repeat-center
    
    
    &:first-child{
      margin-left: 15px;
  
    }
  }
  
  .communityCardTag {
    padding: 3px 0px;
    border-radius: 3px;
    font-size: 12px;
    background: #ff4358;
    color: #FFFFFF;
    width: 40px;
    text-align: center;
  }
  
  .communityCard > p {
    color: #FFFFFF;
  }
</style>
